import { useAxios } from '@/hooks/web/useAxios'

const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 数据权限列表
export const daListApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminDaList',
      data: data
    }
  })
}

// 功能权限修改
export const daEditApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminDaEdit',
      data: data
    }
  })
}

// 功能权限新增
export const daAddApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminDaAdd',
      data: data
    }
  })
}

// 功能权限删除
export const daDelApi = (data: any) => {
  return request.post({
    url: 'https://api.user.grazlink.com/index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminDaDel',
      data: data
    }
  })
}
